From 4cfaee99e782e12e5f6050e41a16e49f8fc9656b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 23 Feb 2018 13:48:20 +0100 Subject: [PATCH] vulkan: Add error strings for missing VkResults Also, guard newer error returns with proper #if, so they don't trip up older Vulkan versions. --- gdk/gdkvulkancontext.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index df502c5d4e..21be067b61 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -131,8 +131,10 @@ gdk_vulkan_strerror (VkResult result) return "Too many objects of the type have already been created."; case VK_ERROR_FORMAT_NOT_SUPPORTED: return "A requested format is not supported on this device."; +#if VK_HEADER_VERSION >= 24 case VK_ERROR_FRAGMENTED_POOL: return "A requested pool allocation has failed due to fragmentation of the pool’s memory."; +#endif case VK_ERROR_SURFACE_LOST_KHR: return "A surface is no longer available."; case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR: @@ -145,8 +147,18 @@ gdk_vulkan_strerror (VkResult result) return "The application caused the validation layer to fail."; case VK_ERROR_INVALID_SHADER_NV: return "One or more shaders failed to compile or link."; +#if VK_HEADER_VERSION >= 39 case VK_ERROR_OUT_OF_POOL_MEMORY_KHR: + return "A pool memory allocation has failed."; +#endif +#if VK_HEADER_VERSION >= 54 case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR: + return "An external handle is not a valid handle of the specified type."; +#endif +#if VK_HEADER_VERSION >= 64 + case VK_ERROR_NOT_PERMITTED_EXT: + return "The caller does not have sufficient privileges."; +#endif case VK_RESULT_RANGE_SIZE: case VK_RESULT_MAX_ENUM: default: -- 2.30.2